<?php
use app\common\config\autoreply_config;
use app\common\helper\index_msg_helper;
use app\common\helper\appmsg_helper;
use app\common\helper\autoreply_helper;
?>

{include file="../app/common/admin/lib/header.html"  title="自动回复"}
{include file="../app/autoreply/view/lib/top_menu.html"}

<div class="page-header border-bottom clearfix">
    <h2 class="left">关键字管理<span>在这里对关键字进行管理</span></h2>
    <a href="{:url('autoreply/add/4')}" class="btn btn-success btn-sm right">添加关键字</a>
</div>

<table class="list-table table-sm table-sm01 table table-bordered" cellpadding="0" cellspacing="0" style="width:100%;">
    <thead>
    <tr>
        <th style="width:16%;">标题</th>
        <th style="width:250px;">关键词</th>
        <th style="width:120px;">活动链接</th>
        <th style="width:120px;">状态</th>
        <th style="width:125px;">添加时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {if !empty($list['data'])}
    {foreach list['data'] as $k=>$v}
    <tr data-id="{$v.id}">
        <td>{if !$v.title}--{else}{$v.title}{/if}</td>
        <td {$content_count = autoreply_helper::get_autoreply_content_count($v.id)} {if $content_count != 1} valign="top" {/if}>
        {$key_list = autoreply_helper::get_autoreply_key_list($v.id, 2)}
        {if $key_list}
        {foreach $key_list as $k1 => $v1}
        <div class="list-per-keywords js_perKey" data-id="{$v1.id}" data-match="{$v1.match_type}" {if !isset($key_list[$k1+1])}style="border-bottom:0 none;"{/if}>
        <span style="display:inline-block;width:150px;overflow:hidden;">{$v1.title}</span>
        <span class="js_perMatch" style="color:#39b3d7; font-size:12px; cursor:pointer; display:none;">{if $v1.match_type == 1}未全匹配{else}全部匹配{/if}</span>
        </div>
        {/foreach}
        {/if}
        </td>
        <td>{:autoreply_helper::get_autoreply_content_str($v.id)}</td>
        <td>{:time_format($v.add_time)}</td>
        <td>
            <a href='{:url("/autoreply/add/3", ["id"=>$v.id])}' class="btn btn-info btn-xs">编辑</a>
            <a href="javascript:void(0);" class="btn btn-danger btn-xs js_deleteKey" data-id="{$v.id}">删除</a>
        </td>
    </tr>
    {/foreach}
    {else /}
    <tr><td colspan="6">暂无数据</td></tr>
    {/if}
    </tbody>
</table>

{include file="../app/common/admin/lib/footer.html"}